package com.bw.liuyushan.liuyushan20210904.MVP.Presenter;

import com.bw.liuyushan.liuyushan20210904.Entity.VideoBean;
import com.bw.liuyushan.liuyushan20210904.MVP.Contrack.IContrackTest;
import com.bw.liuyushan.mvp_lib.Presenter.BasePresenter;

import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;

/**
 * Liuyushan20210904
 * file name is : BasePresenterTest
 * created by Ender on 2021/9/4 8:19.
 * author : 刘雨杉
 * Describe:Presenter实现类的测试类
 */
public class BasePresenterTest extends BasePresenter<IContrackTest.C_ModelTest, IContrackTest.C_ViewTest> {
    Disposable disposable;//RxJava防内存泄露
    public BasePresenterTest(IContrackTest.C_ModelTest mPresenter, IContrackTest.C_ViewTest mView) {
        super(mPresenter, mView);
    }
    public void mpVideo(String url){
        mModel.askVideo(url, new Observer<VideoBean>() {
            @Override
            public void onSubscribe(Disposable d) {
                disposable=d;//RxJava防内存泄露
            }

            @Override
            public void onNext(VideoBean videoBean) {
                mView.ShowVideo(videoBean);
            }

            @Override
            public void onError(Throwable e) {

            }

            @Override
            public void onComplete() {

            }
        });
    }

}
